package com.cysyz.mysitemesh.tagrules;

import com.cysyz.mysitemesh.tagrules.html.BreadcrumbTagRule;
import org.sitemesh.SiteMeshContext;
import org.sitemesh.content.ContentProperty;
import org.sitemesh.content.tagrules.TagRuleBundle;
import org.sitemesh.content.tagrules.html.ExportTagToContentRule;
import org.sitemesh.tagprocessor.State;

/**
 * Created by cuiyong on 15/5/13.
 */
public class MyTagRuleBundle implements TagRuleBundle {
    @Override
    public void install(State defaultState, ContentProperty contentProperty,
                        SiteMeshContext siteMeshContext) {
        defaultState.addRule("operationArea", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("operationArea"), false));
        defaultState.addRule("searchArea", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("searchArea"), false));
        defaultState.addRule("tableArea", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("tableArea"), false));

    }

    @Override
    public void cleanUp(State defaultState, ContentProperty contentProperty,
                        SiteMeshContext siteMeshContext) {
    }

}